package com.zrq.mytopbar;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //调用者
        Topbar topbar= (Topbar) findViewById(R.id.topbar);

        topbar.setOnTopbarClickListener(new Topbar.topbarClickListener() {
           @Override
            public void leftClick() {
               Toast.makeText(MainActivity.this, "左边的Button", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void rightClick() {
                Toast.makeText(MainActivity.this, "右边的Button", Toast.LENGTH_SHORT).show();
            }
        });

        topbar.setLeftIsvisable(false);
    }
}
